home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / PartMaker 4.4 / PartMaker Documents / Script Runner• / Script Runner•.rsrc / dFRK_5004 < prev    next >
Encoding:
Text File  |  1995-12-12  |  3.8 KB  |  154 lines

  1. /*------------------------------------------------------------------------------
  2.     File:        DataTransferExt.cpp
  3.  
  4.     Contains:    Data Transfer Extension class implementation
  5.  
  6.     Written by:    Andrey Dolgachev, Sue Dumont
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. ------------------------------------------------------------------------------*/
  10.  
  11. // -- Compiler/Preprocessor Notification --
  12.  
  13. #ifndef _COMPILERDEFS_
  14. #include "CompDefs.h"
  15. #endif
  16.  
  17. // -- OpenDoc Utilities --
  18.  
  19. #ifndef _EXCEPT_
  20. // Exceptions define several important macros (ie. CHECKENV)
  21. // which are used in the SOM method dispatch glue. If Except.h
  22. // is not included early enough, exceptions may not be thrown
  23. // correctly when returning from a SOM method with "ev" parameter set.
  24. #include <Except.h>
  25. #endif
  26.  
  27. // Notification that this is a SOM source file
  28. #define SampleCode_DataTransferExt_Class_Source
  29.  
  30.  
  31. // define underscore field names (ie. _fSelf)
  32. #define VARIABLE_MACROS
  33.  
  34. // -- DataTransferExt Includes --
  35.  
  36. #ifndef SOM_SampleCode_DataTransferExt_xih
  37. #include "DataTransferExt.xih"
  38. #endif
  39.  
  40. // -- OpenDoc Includes --
  41.  
  42. #ifndef _ODTYPES_
  43. #include <ODTypes.h>
  44. #endif
  45.  
  46. #ifndef SOM_ODExtension_xh
  47. #include <Extensn.xh>
  48. #endif
  49.  
  50.  
  51. // -- OpenDoc Utilities --
  52.  
  53. #ifndef _ODMEMORY_
  54. #include <ODMemory.h>
  55. #endif
  56.  
  57. #ifndef _BARRAY_
  58. #include <BArray.h>
  59. #endif
  60.  
  61. #ifndef _ODUTILS_
  62. #include <ODUtils.h>
  63. #endif
  64.  
  65. //#ifndef _TEMPOBJ_
  66. //#include <TempObj.h>
  67. //#endif
  68.  
  69.  
  70. #pragma segment DataTransferExt
  71.  
  72.  
  73. //------------------------------------------------------------------------------
  74. // Method:            Release
  75. // Origin:            ODRefCountedObject
  76. //
  77. // Description:        The Release method decrements an object’s reference count
  78. //                    by 1, and tells the draft to release the object from 
  79. //                    memory if the ref count falls to 0. The parent class
  80. //                    must be called at the beginning of this method.
  81. //------------------------------------------------------------------------------
  82. SOM_Scope     void
  83. SOMLINK        DataTransferExt__Release
  84.             (
  85.                 SampleCode_DataTransferExt*        somSelf,
  86.                 Environment*                    ev
  87.             )
  88. {
  89.     SampleCode_DataTransferExtMethodDebug("DataTransferExt","Release");
  90.  
  91.     SampleCode_DataTransferExt_parent_ODExtension_Release(somSelf, ev);
  92. }
  93.  
  94. //------------------------------------------------------------------------------
  95. // Method:            InitDataTransferExt
  96. // Origin:            DataTransferExt
  97. //
  98. // Description:
  99. //------------------------------------------------------------------------------
  100. SOM_Scope     void
  101. SOMLINK     DataTransferExt__InitDataTransferExt
  102.             (
  103.                 SampleCode_DataTransferExt*        somSelf,
  104.                 Environment*                    ev,
  105.                 ODPart*                         owner
  106.             )
  107. {
  108.     SampleCode_DataTransferExtMethodDebug("DataTransferExt","InitDataTransferExt");
  109.  
  110.     somSelf->InitExtension(ev, owner);
  111. }
  112.  
  113. //------------------------------------------------------------------------------
  114. // Method:        GetData
  115. // Origin:        DataTransferExt
  116. //
  117. // Description:    This method is called by the client part to obtain data from
  118. //                the extension owner.
  119. //------------------------------------------------------------------------------
  120. SOM_Scope    ODBoolean
  121. SOMLINK        DataTransferExt__GetData
  122.             (
  123.                 SampleCode_DataTransferExt*        somSelf,
  124.                 Environment*                    ev,
  125.                 ODPlatformType                     type,
  126.                 ODByteArray*                    data
  127.             )
  128. {
  129.     SampleCode_DataTransferExtMethodDebug("DataTransferExt","GetData");
  130.  
  131.     return kODFalse;
  132. }
  133.  
  134. //------------------------------------------------------------------------------
  135. // Method:        SetData
  136. // Origin:        DataTransferExt
  137. //
  138. // Description:    This method retrieves the data from the ODByteArray and
  139. //                passes it through to the subclass.
  140. //------------------------------------------------------------------------------
  141. SOM_Scope    ODBoolean
  142. SOMLINK        DataTransferExt__SetData
  143.             (
  144.                 SampleCode_DataTransferExt*    somSelf,
  145.                 Environment*                ev,
  146.                 ODPlatformType                type,
  147.                 ODByteArray*                 data
  148.             )
  149. {
  150.     SampleCode_DataTransferExtMethodDebug("DataTransferExt","SetData");
  151.  
  152.     return kODFalse;
  153. }
  154.